package string;

public class MatchesDemo {
    public static void main(String[] args) {
        String str = "我去";
        boolean b = str.matches("我[去草艹]");
        System.out.println(b);

        str = "我来";
        b = str.matches("我[去草艹]");
        System.out.println(b);

        str = "我去草";
        b = str.matches("我[去草艹]");
        System.out.println(b);


        String name = "$s";
        b = name.matches("[a-zA-Z_$][a-zA-Z0-9_$]"); //[a-zA-Z_$][\w$]?
        System.out.println(b);



    }
}
